<template>
	<inline-Modal :visible="visible" title="组织机构" :showOk="false" @cancel="() => {$emit('cancel')}">
		<vue2-org-tree :data="data[0]"/>
	</inline-Modal>
</template>

<script>
	export default {
		props: {
			visible: {
				type: Boolean,
				default: false
			}
		},
		data(){
			return {
				data: []
			}
		},
		methods: {
			handleTreeData(arr) {
				if(arr.length){
					arr.forEach(item => {
						item.label = item.orgName
					  this.handleTreeData(item.children);
					});
				}
			},
			getOrgData(data){
				this.data = data
				this.handleTreeData(this.data)
			}
		}
	}
</script>

<style>
</style>